#include <exception>
#include "base/Mem.h"

namespace {
    static unsigned char buff[1000] = {0};
    bool isUsed = false;
}

bool hasUB()
{
    return !isUsed;
}

void* getUB()
{
    if(isUsed) throw std::exception();
    isUsed = true;
    return (void*)buff;
}

void retUB(void* p)
{
    if(p != buff) throw std::exception();
    isUsed = false;
}
